home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form Form1
- Caption = "Mouse_Move And Mouse_Down"
- ClientHeight = 7650
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 8775
- Icon = "Mouse.frx":0000
- LinkTopic = "Form1"
- ScaleHeight = 7650
- ScaleWidth = 8775
- StartUpPosition = 3 'Windows Default
- Begin VB.TextBox Text2
- DragMode = 1 'Automatic
- Height = 375
- Left = 1920
- TabIndex = 7
- Tag = "text2 text box"
- Text = " "
- Top = 7080
- Width = 4815
- End
- Begin VB.CheckBox Check4
- Caption = "Right"
- Height = 255
- Left = 7800
- TabIndex = 6
- Top = 480
- Width = 855
- End
- Begin VB.CheckBox Check3
- Caption = "Left"
- Height = 255
- Left = 6960
- TabIndex = 5
- Top = 480
- Width = 735
- End
- Begin VB.TextBox Text1
- Alignment = 2 'Center
- Enabled = 0 'False
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 4440
- MultiLine = -1 'True
- TabIndex = 3
- Top = 0
- Width = 4335
- End
- Begin VB.CommandButton Command1
- Caption = "End"
- Height = 495
- Left = 7080
- TabIndex = 2
- Top = 7080
- Width = 1575
- End
- Begin VB.CheckBox Check2
- BackColor = &H80000012&
- Caption = "Follow"
- ForeColor = &H8000000E&
- Height = 255
- Left = 120
- TabIndex = 1
- Tag = "Follow Check Box"
- Top = 6960
- Width = 1455
- End
- Begin VB.CheckBox Check1
- BackColor = &H80000007&
- Caption = "Circles"
- ForeColor = &H8000000E&
- Height = 255
- Left = 120
- TabIndex = 0
- Tag = "Circle check box"
- Top = 6480
- Width = 1455
- End
- Begin VB.Label Label3
- Caption = "Drag this Button and the text box below"
- Enabled = 0 'False
- Height = 375
- Left = 2880
- TabIndex = 9
- Top = 6480
- Width = 3375
- End
- Begin VB.Label Label2
- Caption = "Click Here"
- Enabled = 0 'False
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 18
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 855
- Left = 4560
- TabIndex = 8
- Top = 2400
- Width = 3015
- End
- Begin VB.Label Label1
- Caption = "This is only a training a form to demonstrate mouse up, down, and move functions. "
- Height = 975
- Left = 120
- TabIndex = 4
- Top = 2040
- Width = 2535
- End
- Begin VB.Shape Shape1
- DrawMode = 1 'Blackness
- FillStyle = 0 'Solid
- Height = 1455
- Left = 0
- Shape = 4 'Rounded Rectangle
- Tag = "Shape1"
- Top = 6120
- Width = 1695
- End
- Begin VB.Image Image2
- Height = 855
- Left = 0
- Picture = "Mouse.frx":0442
- Stretch = -1 'True
- Tag = "Image2"
- Top = 0
- Width = 855
- End
- Begin VB.Image Image1
- DragMode = 1 'Automatic
- Height = 480
- Left = 3960
- Picture = "Mouse.frx":534D
- Tag = "Button"
- Top = 5640
- Width = 480
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub Check2_Click()
- If Check2.Value = 1 Then MsgBox "Click anywhere on the form and the picture will follow"
- End Sub
- Private Sub Command1_Click()
- End Sub
- Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
- Source.Move X, Y
- End Sub
- Private Sub Form_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
- Text2.Text = "You are Moving the " + Source.Tag
- End Sub
- Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- If Button = 1 Then
- Text1.Text = "The left button is currently down"
- End If
- If Button = 2 Then
- Text1.Text = "The right button is currently down"
- End If
- If Button = 4 Then
- Text1.Text = "The middle button is currently down"
- End If
- If Check2 = 1 Then
- Image2.Move X, Y
- End If
- If (Button And 1) = 1 Then
- Check3.Value = 1
- Else
- Check3.Value = 0
- End If
- If (Button And 2) = 2 Then
- Check4.Value = 1
- Else
- Check4.Value = 0
- End If
- End Sub
- Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- If Check1.Value = 1 Then Circle (X, Y), 40
- End Sub
- Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Image1.BorderStyle = 1
- End Sub
- Private Sub Image1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Image1.BorderStyle = 0
- End Sub
- Private Sub Image2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Image2.BorderStyle = 1
- End Sub
- Private Sub Image2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Image2.BorderStyle = 0
- End Sub
-